import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { CloudSharedModule } from '../../shared/shared.module';
import { ConfigService } from '../../core/common/config.service';
import { Http, XSRFStrategy, XHRBackend, RequestOptions } from '@angular/http';
import { LocalXSRFStrategy } from '../../core/http/local-xsrf-strategy.service';
import { httpFactory } from '../../core/http/http.factory';
import { AccountmanageComponent } from './accountmanage/accountmanage.component';
import { Router } from '@angular/router';
import { CustomerService } from '../crm/service/customer.service';
import { CommonService } from '../../core/common/common.service';
const routes: Routes = [
  { path: '', redirectTo: 'console/sys' },
  { path: 'accountManage', component: AccountmanageComponent },
];

@NgModule({
  imports: [
    CloudSharedModule,
    RouterModule.forChild(routes),
    FormsModule
  ],
  declarations: [ AccountmanageComponent],
  exports: [
    RouterModule
  ],
  providers: [ConfigService, CustomerService, CommonService,
    {
      provide: XSRFStrategy, useClass: LocalXSRFStrategy,
    },
    {
      provide: Http,
      useFactory: httpFactory,
      deps: [XHRBackend, RequestOptions, ConfigService, Router]
    }
  ]
})
export class SystemModule { }
